var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("CommonHelper"),
    s = cc._decorator,
    l = s.ccclass,
    c = s.property,
    d = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.give_up_view = []), t;
        }
        return (
            __extends(t, e),
            (t.prototype.initView = function () {
                for (var e = this, t = 0; t < 3; t++)
                    (this.give_up_view[t].children[0].active = 0 == t), (this.give_up_view[t].children[1].active = !1);
                this.scheduleOnce(function () {
                    e.showAiChoose(1);
                }, r.default.getRandomInt(20, 40) / 10);
            }),
            (t.prototype.showAiChoose = function (e) {
                var t = this,
                    o = r.default.getRandomInt(1, 100) < 50;
                (this.give_up_view[e].children[0].active = o),
                    (this.give_up_view[e].children[1].active = !o),
                    o
                        ? this.scheduleOnce(function () {
                              (i.GlobalParams.GameStart = !1),
                                  (i.GlobalParams.GamePlayerWin = !1),
                                  t.emitEvent(a.default.SEND_GAME_OVER_INFO),
                                  (t.node.active = !1);
                          }, 2)
                        : 2 == e
                        ? this.scheduleOnce(function () {
                              (i.GlobalParams.GameGiveUpTime = new Date().getTime() + 6e4), (t.node.active = !1);
                          }, 3)
                        : this.scheduleOnce(function () {
                              t.showAiChoose(2);
                          }, r.default.getRandomInt(20, 40) / 10);
            }),
            __decorate([c(cc.Node)], t.prototype, "give_up_view", void 0),
            __decorate([l], t)
        );
    })(n.default);
o.default = d;
